﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
using BL;
using System.Drawing;

namespace OpenLeuvenPortaal.Views.StartPagina
{
    public partial class UserProfile : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Submit_Click(object sender, EventArgs e)
        {
            string loggedinuser = Session["gebruikersnaam"].ToString();
            
            
            Authentication changes = new Authentication();
            Gebruiker edituser = changes.Getuser(loggedinuser);
            //HashHandle hash = new HashHandle();

            string passwoord = oudww.Text;
            if (passwoord == edituser.Paswoord)
            {
                edituser.Paswoord = nieuwWW.Text;

                changes.UpdateUser(edituser);
                statustxt.ForeColor = Color.Green;
                statustxt.Text = "Nieuw wachtwoord opgeslagen";
            }
            else
            {
                statustxt.Text = "Oud wachtwoord klopt niet";
            }
            
        }
    }
}